{extend name="layouts/main" /}
{block name="css"}
<style>
	.layui-setting .layui-form-label {
		width: 141px;
		text-align: center;
	}
	.layui-setting .layui-input-block {
		margin-left: 141px;
		left: -1px;
	}
</style>
{/block}
{block name="content"}
<div class="layui-body" style="top: 0px;left: 0px;">
	<!-- 内容主体区域 -->
	<div class="layui-fluid" style="position: relative;margin: 0 auto;padding: 7px;padding-top: 0px;">
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
			<ul class="layui-tab-title">
				<li class="layui-this">采集列表信息配置</li>
				<li class="">采集内容信息配置</li>
			</ul>
			<div class="layui-tab-content layui-setting form-horizontal">
				<div class="layui-tab-item  layui-show">
					<form class="layui-form layui-form-pane" name="form1" action="">
						<input type="hidden" name="id" value="{$id}" class="upload-text" />
						<div class="layui-form-item">
							<label class="layui-form-label">节点名称</label>
							<div class="layui-input-block">
								<input type="text" name="node_name" value="{$node.node_name}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="sysval"><em class="zerocopy">node_name</em></span>
							</div>
						</div>
						<input type="hidden" name="model_id" value="{$model_id}" class="upload-text">
						<div class="layui-form-item">
							<label class="layui-form-label">所属模型</label>
							<div class="layui-input-block">
								<select name="model_id" lay-verify="required" class="upload-select" disabled>
									{volist name="modelRes" id="vo"}
                                    <option value="{$vo.id}" {if condition="$vo['id'] eq $model_id"}selected{/if}>{$vo.title}</option>
                                    {/volist}
								</select>
								<span class="sysval"><em class="zerocopy">model_id</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">输出编码</label>
							<div class="layui-input-block">
								<input type="radio" name="output_encoding" value="UTF-8" title="UTF-8" {if condition="$node['output_encoding'] eq 'UTF-8'"} checked="checked" {/if} class="upload-radio">
								<input type="radio" name="output_encoding" value="GB2312" title="GB2312" {if condition="$node['output_encoding'] eq 'GB2312'"} checked="checked" {/if} class="upload-radio">
								<span class="sysval"><em class="zerocopy">output_encoding</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">输入编码</label>
							<div class="layui-input-block">
								<input type="radio" name="input_encoding" value="UTF-8" title="UTF-8" class="upload-radio">
								<input type="radio" name="input_encoding" value="GB2312" title="GB2312" class="upload-radio">
								<span class="sysval"><em class="zerocopy">input_encoding</em></span>
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label">列表URL</label>
							<div class="layui-input-block">
								<textarea name="list_url" placeholder="" style="cursor: pointer;" title="例如：http://www.58pic.com/tupian/28906338-0-0-(*).html或http://www.williamlong.info/cat/?page=(*)/" class="layui-textarea upload-text">{$listRules.list_url}</textarea>
								<span class="layui-form-mid layui-word-aux">
									[ 动态页码使用(*)代替，例如：http://www.58pic.com/tupian/28906338-0-0-(*).html或http://www.williamlong.info/cat/?page=(*)/ ]
								</span>
								<span class="sysval"><em class="zerocopy">list_url</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">页码配置</label>
								<div class="layui-form-mid">从</div>
								<div class="layui-input-inline" style="width: 180px;">
									<input type="text" name="start_page" placeholder="起始页码" autocomplete="off" class="layui-input upload-text" value="{$listRules.start_page}">
									<span class="sysval"><em class="zerocopy">start_page</em></span>
								</div>
								<div class="layui-form-mid">到</div>
								<div class="layui-input-inline" style="width: 180px;">
									<input type="text" name="end_page" placeholder="结束页码" autocomplete="off" class="layui-input upload-text" value="{$listRules.end_page}">
									<span class="sysval"><em class="zerocopy">end_page</em></span>
								</div>
								<div class="layui-form-mid">每次递增</div>
								<div class="layui-input-inline" style="width: 150px;">
									<input type="text" name="step" placeholder="步长" autocomplete="off" class="layui-input upload-text" value="{$listRules.step}">
									<span class="sysval"><em class="zerocopy">step</em></span>
								</div>
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label">采集范围(区域选择器)</label>
							<div class="layui-input-block">
								<textarea name="range" placeholder="" class="layui-textarea upload-text">{$listRules.range}</textarea>
								<span class="layui-form-mid layui-word-aux">
									[ 采集范围(区域选择器)，例如：.post>ul>li ]
								</span>
								<span class="sysval"><em class="zerocopy">range</em></span>
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label">URL采集规则</label>
							<div class="layui-input-block">
								<textarea name="url" placeholder="" class="layui-textarea upload-text">{$listRules.list_rules.url}</textarea>
								<span class="layui-form-mid layui-word-aux">
									[ URL采集规则，例如：li>div.listimg>a ]
								</span>
								<span class="sysval"><em class="zerocopy">url</em></span>
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label">缩略图采集规则</label>
							<div class="layui-input-block">
								<textarea name="litpic" placeholder="" class="layui-textarea upload-text">{$listRules.list_rules.litpic}</textarea>
								<span class="layui-form-mid layui-word-aux">
									[ 缩略图采集规则，例如：li>div.listimg>a>img ]
								</span>
								<span class="sysval"><em class="zerocopy">litpic</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">缩略图字段名</label>
							<div class="layui-input-block">
								<input type="text" name="thumb_field" value="{$node.thumb_field|default='thumb'}" required="" lay-verify="required" placeholder="缩略图字段名" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 所选模型的缩略图字段名 ]
								</span>
								<span class="sysval"><em class="zerocopy">thumb_field</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">下载图片</label>
							<div class="layui-input-block">
								<input type="radio" name="down_attachment" value="1" title="是" checked="" class="upload-radio">
								<input type="radio" name="down_attachment" value="0" title="否" class="upload-radio">
								<span class="sysval"><em class="zerocopy">down_attachment</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">图片水印</label>
							<div class="layui-input-block">
								<input type="radio" name="watermark" value="1" title="是" checked="" class="upload-radio">
								<input type="radio" name="watermark" value="0" title="否" class="upload-radio">
								<span class="sysval"><em class="zerocopy">watermark</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">状态</label>
							<div class="layui-input-block">
								<input type="radio" name="status" value="1" title="显示" checked="" class="upload-radio">
								<input type="radio" name="status" value="0" title="隐藏" class="upload-radio">
								<span class="sysval"><em class="zerocopy">status</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">排序</label>
							<div class="layui-input-block">
								<input type="text" name="sort" value="{$node.sort|default=0}" required="" lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input upload-text">
								<span class="sysval"><em class="zerocopy">sort</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-input-block">
								<button class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">确定</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
							</div>
						</div>
					</form>
				</div>
				<div class="layui-tab-item">
					<form class="layui-form layui-form-pane" action="">
						<!-- 模型自定义字段开始-->
                        {if condition="$modelFieldRes"}
                        {volist name="modelFieldRes" id="modelField"}
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label" title="{$modelField.title}">{$modelField.title}</label>
								<div class="layui-form-mid"></div>
								<div class="layui-input-inline" style="width: 332px;">
									<input type="text" name="{$modelField.name}[0]" placeholder="" autocomplete="off" class="layui-input upload-text" value="<?php echo $itemRules[$modelField['name']][0];?>">
									<span class="layui-form-mid layui-word-aux">
										[ 采集规则，例：.list_thumbnail>img ]
									</span>
									<span class="sysval"><em class="zerocopy">{$modelField.name}[0]</em></span>
								</div>
								<div class="layui-form-mid"></div>
								<div class="layui-input-inline" style="width: 332px;">
									<input type="text" name="{$modelField.name}[1]" placeholder="" autocomplete="off" class="layui-input upload-text" value="<?php echo $itemRules[$modelField['name']][1];?>">
									<span class="layui-form-mid layui-word-aux">
										[ 采集属性，例：html或text或href或src ]
									</span>
									<span class="sysval"><em class="zerocopy">{$modelField.name}[1]</em></span>
								</div>
								<div class="layui-form-mid"></div>
								<div class="layui-input-inline" style="width: 332px;">
									<input type="text" name="{$modelField.name}[2]" placeholder="" autocomplete="off" class="layui-input upload-text" value="<?php echo $itemRules[$modelField['name']][2];?>">
									<span class="layui-form-mid layui-word-aux">
										[ 过滤规则，例：-.tt -span:last -p:last ]
									</span>
									<span class="sysval"><em class="zerocopy">{$modelField.name}[2]</em></span>
								</div>
							</div>
						</div>
						{/volist}
                		{/if}
						<div class="layui-form-item">
							<div class="layui-input-block">
								<input type="hidden" name="id" value="{$id}">
								<button class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">确定</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="js"}
<script type="text/javascript">
    $("select[name='model_id']").val({$node.model_id|default=0});
    $("input[name='down_attachment'][value={$node.down_attachment|default = 1}]").attr("checked","checked");
    $("input[name='watermark'][value={$node.watermark|default = 1}]").attr("checked","checked");
    $("input[name='status'][value={$node.status|default = 0}]").attr("checked","checked");
    $("input[name='output_encoding'][value={$node.output_encoding|default = 'UTF-8'}]").attr("checked","checked");
    $("input[name='input_encoding'][value={$node.input_encoding|default = 'UTF-8'}]").attr("checked","checked");
</script>
{/block}
